<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

/**
 * 用户－角色表
 * Class CreateUserRoleTable
 */
class CreateUserRoleTable extends Migration
{
		/**
		 * 用户－角色关联表迁移
		 * Run the migrations.
		 *
		 * @return void
		 */
		public function up()
		{
				Schema::create('user_role', function(Blueprint $table)
				{
						$table->increments('id')->comment('表主键,自增');
						$table->unsignedInteger('user_id')->comment('外键，用户id');
						$table->unsignedInteger('role_id')->comment('外键，角色id');
				});
		}

		/**
		 * 用户－角色关联表回滚
		 * Reverse the migrations.
		 *
		 * @return void
		 */
		public function down()
		{
				Schema::drop('user_role');
		}
}
